package org.jimmy.tang.factorybean;

import org.jimmy.tang.factorybean.BasicDataSourceFactoryBean.BasicDataSource;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author jimmy
 * 
 */
public class BasicDataSourceFactoryBean implements FactoryBean<BasicDataSource> {

    @Override
    public BasicDataSource getObject() throws Exception {
        BasicDataSource dataSource = new BasicDataSource();

        // 读取外部配置, 设置到 dataSource 中 ...

        return dataSource;
    }

    @Override
    public Class<BasicDataSource> getObjectType() {
        return BasicDataSource.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }

    class BasicDataSource {
    }

}